package light.head.model.el;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;
/**
 * 班级课程题目指定表
 */
@Table
@Entity
@IdClass(ClassCourseTopicRelationPK.class)
public class ClassCourseTopicRelation implements Serializable{
	
	private static final long serialVersionUID = 7111494716265473407L;
	private Integer clc;			// 班级编号
	private Integer cc;				// 课程编号
	private Integer tc;				// 题目编号
	private Integer tic;			// 模板明细编号
	private Float points;			// 题目分数
	
	//Formula
	private Byte type ;				// 题目类型
	
	
	
	@Id
	@Column
	public Integer getClc() {
		return clc;
	}
	@Id
	@Column
	public Integer getCc() {
		return cc;
	}
	@Id
	@Column
	public Integer getTc() {
		return tc;
	}
	
	@Column
	public Integer getTic() {
		return tic;
	}
	
	@Column
	public Float getPoints() {
		return points;
	}
	
	@Formula("(SELECT t.type FROM Topic t WHERE t.code = tc)")
	public Byte getType() {
		return type;
	}
	
	public void setClc(Integer clc) {
		this.clc = clc;
	}
	public void setCc(Integer cc) {
		this.cc = cc;
	}
	public void setTic(Integer tic) {
		this.tic = tic;
	}
	public void setTc(Integer tc) {
		this.tc = tc;
	}
	public void setPoints(Float points) {
		this.points = points;
	}
	public void setType(Byte type) {
		this.type = type;
	}
}
